const wearDao=require('../dao/wearDao');

async function findByKind(kind) {
    // if(kind==null||kind=={}||kind==undefined||kind==[]){
    //     kind='kids';
    // }
    try{
        //查询衣服，能返回
        var data = await wearDao.findByKind(kind);
        return {success:true,wears:data};
    }catch(e){
        //不能返回
        return {success:false,msg:'database is error!'};
    }
}
async function findByImgsrc(imgsrc) {
    try{
        //查询衣服，能返回
        var data = await wearDao.findByImgsrc(imgsrc);
        return {success:true,wears:data};
    }catch(e){
        //不能返回
        return {success:false,msg:'database is error!'};
    }
}
exports.findByKind=findByKind;
exports.findByImgsrc=findByImgsrc;